\(\int x^2 \log (c (a+b x^2)^p) \, dx\) [3]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 66 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\frac {2 a p x}{3 b}-\frac {2 p x^3}{9}-\frac {2 a^{3/2} p \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{3 b^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right ) \]

[Out]

2/3*a*p*x/b-2/9*p*x^3-2/3*a^(3/2)*p*arctan(x*b^(1/2)/a^(1/2))/b^(3/2)+1/3*x^3*ln(c*(b*x^2+a)^p)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {2505, 308, 211} \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=-\frac {2 a^{3/2} p \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{3 b^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right )+\frac {2 a p x}{3 b}-\frac {2 p x^3}{9} \]

[In]

Int[x^2*Log[c*(a + b*x^2)^p],x]

[Out]

(2*a*p*x)/(3*b) - (2*p*x^3)/9 - (2*a^(3/2)*p*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(3*b^(3/2)) + (x^3*Log[c*(a + b*x^2)
^p])/3

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 2505

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.)*(x_))^(m_.), x_Symbol] :> Simp[(f*x)^(m +
 1)*((a + b*Log[c*(d + e*x^n)^p])/(f*(m + 1))), x] - Dist[b*e*n*(p/(f*(m + 1))), Int[x^(n - 1)*((f*x)^(m + 1)/
(d + e*x^n)), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && NeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right )-\frac {1}{3} (2 b p) \int \frac {x^4}{a+b x^2} \, dx \\ & = \frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right )-\frac {1}{3} (2 b p) \int \left (-\frac {a}{b^2}+\frac {x^2}{b}+\frac {a^2}{b^2 \left (a+b x^2\right )}\right ) \, dx \\ & = \frac {2 a p x}{3 b}-\frac {2 p x^3}{9}+\frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right )-\frac {\left (2 a^2 p\right ) \int \frac {1}{a+b x^2} \, dx}{3 b} \\ & = \frac {2 a p x}{3 b}-\frac {2 p x^3}{9}-\frac {2 a^{3/2} p \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{3 b^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+b x^2\right )^p\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.94 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\frac {1}{9} \left (\frac {6 a p x}{b}-2 p x^3-\frac {6 a^{3/2} p \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{b^{3/2}}+3 x^3 \log \left (c \left (a+b x^2\right )^p\right )\right ) \]

[In]

Integrate[x^2*Log[c*(a + b*x^2)^p],x]

[Out]

((6*a*p*x)/b - 2*p*x^3 - (6*a^(3/2)*p*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(3/2) + 3*x^3*Log[c*(a + b*x^2)^p])/9

Maple [A] (verified)

Time = 0.43 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.91

method result size
parts \(\frac {x^{3} \ln \left (c \left (b \,x^{2}+a \right )^{p}\right )}{3}-\frac {2 p b \left (-\frac {-\frac {1}{3} b \,x^{3}+a x}{b^{2}}+\frac {a^{2} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{b^{2} \sqrt {a b}}\right )}{3}\) \(60\)
risch \(\frac {x^{3} \ln \left (\left (b \,x^{2}+a \right )^{p}\right )}{3}+\frac {i \pi \,x^{3} \operatorname {csgn}\left (i \left (b \,x^{2}+a \right )^{p}\right ) {\operatorname {csgn}\left (i c \left (b \,x^{2}+a \right )^{p}\right )}^{2}}{6}-\frac {i \pi \,x^{3} \operatorname {csgn}\left (i \left (b \,x^{2}+a \right )^{p}\right ) \operatorname {csgn}\left (i c \left (b \,x^{2}+a \right )^{p}\right ) \operatorname {csgn}\left (i c \right )}{6}-\frac {i \pi \,x^{3} {\operatorname {csgn}\left (i c \left (b \,x^{2}+a \right )^{p}\right )}^{3}}{6}+\frac {i \pi \,x^{3} {\operatorname {csgn}\left (i c \left (b \,x^{2}+a \right )^{p}\right )}^{2} \operatorname {csgn}\left (i c \right )}{6}+\frac {\ln \left (c \right ) x^{3}}{3}-\frac {2 p \,x^{3}}{9}+\frac {\sqrt {-a b}\, a p \ln \left (-\sqrt {-a b}\, x -a \right )}{3 b^{2}}-\frac {\sqrt {-a b}\, a p \ln \left (\sqrt {-a b}\, x -a \right )}{3 b^{2}}+\frac {2 a p x}{3 b}\) \(217\)

[In]

int(x^2*ln(c*(b*x^2+a)^p),x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*ln(c*(b*x^2+a)^p)-2/3*p*b*(-1/b^2*(-1/3*b*x^3+a*x)+a^2/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 152, normalized size of antiderivative = 2.30 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\left [\frac {3 \, b p x^{3} \log \left (b x^{2} + a\right ) - 2 \, b p x^{3} + 3 \, b x^{3} \log \left (c\right ) + 3 \, a p \sqrt {-\frac {a}{b}} \log \left (\frac {b x^{2} - 2 \, b x \sqrt {-\frac {a}{b}} - a}{b x^{2} + a}\right ) + 6 \, a p x}{9 \, b}, \frac {3 \, b p x^{3} \log \left (b x^{2} + a\right ) - 2 \, b p x^{3} + 3 \, b x^{3} \log \left (c\right ) - 6 \, a p \sqrt {\frac {a}{b}} \arctan \left (\frac {b x \sqrt {\frac {a}{b}}}{a}\right ) + 6 \, a p x}{9 \, b}\right ] \]

[In]

integrate(x^2*log(c*(b*x^2+a)^p),x, algorithm="fricas")

[Out]

[1/9*(3*b*p*x^3*log(b*x^2 + a) - 2*b*p*x^3 + 3*b*x^3*log(c) + 3*a*p*sqrt(-a/b)*log((b*x^2 - 2*b*x*sqrt(-a/b) -
 a)/(b*x^2 + a)) + 6*a*p*x)/b, 1/9*(3*b*p*x^3*log(b*x^2 + a) - 2*b*p*x^3 + 3*b*x^3*log(c) - 6*a*p*sqrt(a/b)*ar
ctan(b*x*sqrt(a/b)/a) + 6*a*p*x)/b]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (63) = 126\).

Time = 7.77 (sec) , antiderivative size = 141, normalized size of antiderivative = 2.14 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\begin {cases} \frac {x^{3} \log {\left (0^{p} c \right )}}{3} & \text {for}\: a = 0 \wedge b = 0 \\\frac {x^{3} \log {\left (a^{p} c \right )}}{3} & \text {for}\: b = 0 \\- \frac {2 p x^{3}}{9} + \frac {x^{3} \log {\left (c \left (b x^{2}\right )^{p} \right )}}{3} & \text {for}\: a = 0 \\- \frac {2 a^{2} p \log {\left (x - \sqrt {- \frac {a}{b}} \right )}}{3 b^{2} \sqrt {- \frac {a}{b}}} + \frac {a^{2} \log {\left (c \left (a + b x^{2}\right )^{p} \right )}}{3 b^{2} \sqrt {- \frac {a}{b}}} + \frac {2 a p x}{3 b} - \frac {2 p x^{3}}{9} + \frac {x^{3} \log {\left (c \left (a + b x^{2}\right )^{p} \right )}}{3} & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*ln(c*(b*x**2+a)**p),x)

[Out]

Piecewise((x**3*log(0**p*c)/3, Eq(a, 0) & Eq(b, 0)), (x**3*log(a**p*c)/3, Eq(b, 0)), (-2*p*x**3/9 + x**3*log(c
*(b*x**2)**p)/3, Eq(a, 0)), (-2*a**2*p*log(x - sqrt(-a/b))/(3*b**2*sqrt(-a/b)) + a**2*log(c*(a + b*x**2)**p)/(
3*b**2*sqrt(-a/b)) + 2*a*p*x/(3*b) - 2*p*x**3/9 + x**3*log(c*(a + b*x**2)**p)/3, True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.89 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\frac {1}{3} \, x^{3} \log \left ({\left (b x^{2} + a\right )}^{p} c\right ) - \frac {2}{9} \, b p {\left (\frac {3 \, a^{2} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} + \frac {b x^{3} - 3 \, a x}{b^{2}}\right )} \]

[In]

integrate(x^2*log(c*(b*x^2+a)^p),x, algorithm="maxima")

[Out]

1/3*x^3*log((b*x^2 + a)^p*c) - 2/9*b*p*(3*a^2*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^2) + (b*x^3 - 3*a*x)/b^2)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.89 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\frac {1}{3} \, p x^{3} \log \left (b x^{2} + a\right ) - \frac {1}{9} \, {\left (2 \, p - 3 \, \log \left (c\right )\right )} x^{3} - \frac {2 \, a^{2} p \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{3 \, \sqrt {a b} b} + \frac {2 \, a p x}{3 \, b} \]

[In]

integrate(x^2*log(c*(b*x^2+a)^p),x, algorithm="giac")

[Out]

1/3*p*x^3*log(b*x^2 + a) - 1/9*(2*p - 3*log(c))*x^3 - 2/3*a^2*p*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b) + 2/3*a*p*
x/b

Mupad [B] (verification not implemented)

Time = 1.24 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.76 \[ \int x^2 \log \left (c \left (a+b x^2\right )^p\right ) \, dx=\frac {x^3\,\ln \left (c\,{\left (b\,x^2+a\right )}^p\right )}{3}-\frac {2\,p\,x^3}{9}-\frac {2\,a^{3/2}\,p\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{3\,b^{3/2}}+\frac {2\,a\,p\,x}{3\,b} \]

[In]

int(x^2*log(c*(a + b*x^2)^p),x)

[Out]

(x^3*log(c*(a + b*x^2)^p))/3 - (2*p*x^3)/9 - (2*a^(3/2)*p*atan((b^(1/2)*x)/a^(1/2)))/(3*b^(3/2)) + (2*a*p*x)/(
3*b)